import http from '@/utils/request'

export function generateOrder(query){
	return http.request({
		url:'/system/order',
		method:'post',
		data:query
	})
}

export function pay(query){
	return http.request({
		url:'/system/order/pay',
		method:'get',
		params:query
	})
}

export function getOrderState(query){
	return http.request({
		url:'/system/order/order/'+query,
		method:'get'
	})
}

//查看订单列表数据
export function getOrderByUserid(query){
	return http.request({
		url:'/system/order/list',
		method:'get',
		params:query
	})
}

export function  getOrderByuserId(query) {
	return http.request({
		url: '/system/order/list?userId=3',
		method: 'get',
		params: query
	})
}
export function getOrderByuserIdAndState(state) {
	return http.request({
		url: `/system/order/list?userId=3&state=${state}`,
		method: 'get',
	})
}
export function getOrderDetailByOrdersn(ordersn) {
	return http.request({
		url: `/system/orderdetail/listByOrdersn/${ordersn}`,
		method: "get"
	})
}